import request from '@/api/request.js'



const api_name = 'UserzURL'

const post_name = 'usId'


export default {


	//查询用户所属军队,和职务和信息
	selectUserInforArmy(data) {
		return request({
			url: `${api_name}/selectUserInforArmy`,
			method: 'post',
			timeout: 20000,
			data: data
		})
	},

	//用户密码登录
	user_password_login(data) {
		return request({
			url: `${api_name}/user_password_login`,
			method: 'post',
			timeout: 20000,
			data: data
		})
	},

	//根据User_id查询
	selectByUser_id(user_id) {
		return request({
			url: `/${api_name}/selectByUser_id/${user_id}`,
			method: 'get',
		})
	},

	//用户查询自己的信息
	selectByUser_idMyself(user_id) {
		return request({
			url: `/${api_name}/selectByUser_idMyself/${user_id}`,
			method: 'get',
		})
	},


	//根据User_id更新
	updateByUser_id(demo) {
		return request({
			url: `/${api_name}/updateByUser_id`,
			method: 'post',
			data: demo
		})
	},


	//根据User_id删除
	deleteByUser_id(user_id) {
		return request({
			url: `/${api_name}/deleteByUser_id/${user_id}`,
			method: 'get',
		})
	},




	//insert:(插入)
	insert(demo) {
		return request({
			url: `/${api_name}/insert`,
			method: 'post',
			data: demo
		})
	},


	//insertOrUpdate(插入或更新(根据主键或唯一索引更新，主键和唯一索引不会改变))
	insertOrUpdate(demo) {
		return request({
			url: `/${api_name}/insertOrUpdate`,
			method: 'post',
			data: demo
		})
	},


	//insertBath:(批量插入)
	insertBatch(list) {
		return request({
			url: `/${api_name}/insertBatch`,
			method: 'post',
			data: list
		})
	},


	//insertOrUpdateBatch:(批量插入或更新)
	insertOrUpdateBatch(list) {
		return request({
			url: `/${api_name}/insertOrUpdateBatch`,
			method: 'post',
			data: list
		})
	},


	//selectList:(根据参数查询集合)
	selectList(param) {
		return request({
			url: `/${api_name}/selectList`,
			method: 'post',
			data: param
		})
	},


	// selectCount:(根据集合查询数量)
	selectCount(param) {
		return request({
			url: `/${api_name}/selectCount`,
			method: 'post',
			data: param
		})
	},
	//用户上传头像
	UpdateWithHeader(data, type) {
		return request({
			url: `${api_name}/UpdateWithHeader`,
			method: 'post',
			timeout: 20000,
			data: data,
			headers: {
				'content-type': type,
			}
		})
	}

}
